import DeathKnightAbilityManager from './DeathKnightAbilityManager';
import DruidAbilityManager from './DruidAbilityManager';
import KnightAbilityManager from './KnightAbilityManager';
import PriestAbilityManager from './PriestAbilityManager';
import MagaAbilityManager from './MagaAbilityManager';
import LurkerAbilityManager from './LurkerAbilityManager';
import RangerAbilityManager from './RangerAbilityManager';
import ShamanAbilityManager from './ShamanAbilityManager';
import WarriorAbilityManager from './WarriorAbilityManager';
import WariorMonkAbilityManager from './WariorMonkAbilityManager';
import WarlockAbilityManager from './WarlockAbilityManager';
import AbilityBase from 'code/Scripts/Abilities/base/AbilityBase';
import ClassAbilityManagerBase from './base/ClassAbilityManagerBase';

export default class ClassAbilityManager {
    DK: DeathKnightAbilityManager;
    DLY: DruidAbilityManager;
    QS: KnightAbilityManager;
    MS: PriestAbilityManager;
    FS: MagaAbilityManager;
    DZ: LurkerAbilityManager;
    YX: RangerAbilityManager;
    SM: ShamanAbilityManager;
    ZS: WarriorAbilityManager;
    WS: WariorMonkAbilityManager;
    SS: WarlockAbilityManager;

    private _abilities: Map<string, AbilityBase> = new Map();
    constructor() {
        this.DK = new DeathKnightAbilityManager();
        this.DLY = new DruidAbilityManager();
        this.QS = new KnightAbilityManager();
        this.MS = new PriestAbilityManager();
        this.FS = new MagaAbilityManager();
        this.DZ = new LurkerAbilityManager();
        this.YX = new RangerAbilityManager();
        this.SM = new ShamanAbilityManager();
        this.ZS = new WarriorAbilityManager();
        this.WS = new WariorMonkAbilityManager();
        this.SS = new WarlockAbilityManager();

        this.mapAbilities();
    }
    mapAbilities() {
        for (let [key, value] of this.DK.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.DLY.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.QS.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.MS.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.FS.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.DZ.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.YX.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.SM.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.ZS.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.WS.getAllAbilities()) {
            this._abilities.set(key, value);
        }
        for (let [key, value] of this.SS.getAllAbilities()) {
            this._abilities.set(key, value);
        }
    }
    getClassAbilityById(id: string): AbilityBase {
        return this._abilities.get(id);
    }
}
